#!/bin/bash
apt-get update
if !(which mysql); then
{
echo set "the root password as \"carblogger\" when prompted."
apt-get -y install mysql-server mysql-client libmysqlclient15-dev
wait;
echo $VAR

#For some reason important to restart - otherwise possible errors

#/etc/init.d/mysql stop
#/etc/init.d/mysql start
sleep 60
}
fi
if !(which mysql); then
{
echo "Problem with the install";
echo "Aborting";
exit;
}
fi
echo "Installing the ingest tables";
mysql -u root --password=carblogger < sys_resources/alldb_backup.sql 
echo "Complete";